$(document).ready(function ()
{
	var dataInfo = [
		{
			"Id" : 44,
			"Name" : "Tablero",
			"Description" : "",
			"Area" : "",
			"Pep" : "123132123",
			"PR" : "2123122212",
			"MaterialGroup" : "TRANSFORMERS EQUIPMENT",
			"Plant" : "TM01",
			"Company" : "Hylsa",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Tablero eléctrico",
			"PepProject" : "123132123",
			"Owner" : "SIDERCA\\13533",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 37,
			"Name" : "Line 2 Ipessitore fanghi FTM\t",
			"Description" : "Line 2 Description",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "ELECTRICAL SUBSTATIONS EQUIPMENT",
			"Plant" : "Divisione Dalmine",
			"Company" : "Dalmine\t",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "Dolar",
			"Leader" : "LEALI\n",
			"Project" : "Ipessitore fanghi FTM",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 36,
			"Name" : "Line 1 Ipessitore fanghi FTM\t",
			"Description" : "Line 1 Description",
			"Area" : "",
			"Pep" : "",
			"PR" : "21649037",
			"MaterialGroup" : "ELECTRICAL SUBSTATIONS EQUIPMENT",
			"Plant" : "Divisione Dalmine",
			"Company" : "Dalmine\t",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "Dolar",
			"Leader" : "MALACRIDA",
			"Project" : "Ipessitore fanghi FTM",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 48,
			"Name" : "Line ricambi per adeguamento CE mazak\t",
			"Description" : "",
			"Area" : "12",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "GENERATORS EQUIPMENT",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 51,
			"Name" : "linea",
			"Description" : "",
			"Area" : "",
			"Pep" : "100001",
			"PR" : "",
			"MaterialGroup" : "GENERATORS EQUIPMENT",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "prueba",
			"PepProject" : "1000001",
			"Owner" : "SIDERCA\\13533",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 28,
			"Name" : "Line Regolatore elettrodi CALARASI",
			"Description" : "Desp 2 Test",
			"Area" : "",
			"Pep" : "",
			"PR" : "21436801",
			"MaterialGroup" : "HYDROTESTERS EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Regolatore elettrodi CALARASI",
			"PepProject" : "",
			"Owner" : "AMERICAS\\MOLANOVA",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 26,
			"Name" : "Line Segatrice Costa Volpino",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "HYDROTESTERS EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Segatrice Costa Volpino",
			"PepProject" : "",
			"Owner" : "AMERICAS\\MOLANOVA",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 27,
			"Name" : "Linea Barriere di protezione FAS Expander",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "21635070",
			"MaterialGroup" : "HYDROTESTERS EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Barriere di protezione FAS Expander",
			"PepProject" : "",
			"Owner" : "AMERICAS\\MOLANOVA",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 5,
			"Name" : "Linea Opere civili zona Aggiustaggio\t",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "21547749",
			"MaterialGroup" : "HYDROTESTERS EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Opere civili zona Aggiustaggio",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 50,
			"Name" : "Linea 1",
			"Description" : "",
			"Area" : "",
			"Pep" : "100000",
			"PR" : "",
			"MaterialGroup" : "CRANES EQUIPMENT",
			"Plant" : "sss",
			"Company" : "Siderca",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Proyecto prueba",
			"PepProject" : "10000000",
			"Owner" : "SIDERCA\\13533",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 39,
			"Name" : "Grúa 275 toneladas",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "CRANES EQUIPMENT",
			"Plant" : "planta",
			"Company" : "DS1",
			"Discount" : 0,
			"Budget" : 500000,
			"Currency" : "USD",
			"Leader" : "",
			"Project" : "Grúas proyecto laminador",
			"PepProject" : "",
			"Owner" : "SIDERCA\\13533",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 9,
			"Name" : "Line Nuovi freni bracci rotanti AGG\t",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "SMALL CRANES, SMALL HOISTS EQUIPMENT",
			"Plant" : "",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Nuovi freni bracci rotanti AGG\t",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 35,
			"Name" : "Line montaggi impianto elettrico impianto boro\t",
			"Description" : "Line Description",
			"Area" : "",
			"Pep" : "General",
			"PR" : "21763986",
			"MaterialGroup" : "CHEMICAL INJECTION EQUIPMENT",
			"Plant" : "Divisione Dalmine",
			"Company" : "Dalmine",
			"Discount" : 15,
			"Budget" : 10,
			"Currency" : "Dolar",
			"Leader" : "PANIGA",
			"Project" : "montaggi impianto elettrico impianto boro",
			"PepProject" : "General",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 29,
			"Name" : "Line Nuova radddrizzatubi Arcore\t",
			"Description" : "",
			"Area" : "",
			"Pep" : "General",
			"PR" : "21458386",
			"MaterialGroup" : "VALVES AND VALVE BENCHES EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "BONALDI",
			"Project" : "Nuova radddrizzatubi Arcore",
			"PepProject" : "General",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 38,
			"Name" : "Line Fornitura e Montaggi Oleodinamici Postazione OCR Ingresso TRT1",
			"Description" : "Detalle line 2",
			"Area" : "",
			"Pep" : "",
			"PR" : "21480575",
			"MaterialGroup" : "OTHER AIR AND OLEODINAMIC EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Fornitura e Montaggi Oleodinamici Postazione OCR Ingresso TRT1",
			"PepProject" : "",
			"Owner" : "AMERICAS\\MOLANOVA",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 32,
			"Name" : "Line Tenaris TuBO CARIBE -TRT line handling - commercial tender\t",
			"Description" : "Line Description",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "OTHER AIR AND OLEODINAMIC EQUIPMENT",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "MISTRINI",
			"Project" : "Tenaris TuBO CARIBE -TRT line handling - commercial tender\t",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 30,
			"Name" : "Line ACC - Montaggi elettrici ferroleghe EBT\t",
			"Description" : "Line Description",
			"Area" : "",
			"Pep" : "",
			"PR" : "21490751",
			"MaterialGroup" : "BURNERS FOR GAS FURNACES EQUIPMENT",
			"Plant" : "A050",
			"Company" : "ALGO",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "LEALI",
			"Project" : "ACC - Montaggi elettrici ferroleghe EBT\t",
			"PepProject" : "General",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 10,
			"Name" : "Line montaggi elettrici sala Creep",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "21598838",
			"MaterialGroup" : "GALVANIC TREATMENT PLANTS EQUIPMENT",
			"Plant" : "A050",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "montaggi elettrici sala Creep",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 49,
			"Name" : "Line Prueba",
			"Description" : "Description Line",
			"Area" : "12",
			"Pep" : "",
			"PR" : "3242342",
			"MaterialGroup" : "PHOSPHATIZING TREATMENT PLANTS EQUIPMENT",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Prueba",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 14,
			"Name" : "Line sistema cambio matrici\t",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "PHOSPHATIZING TREATMENT PLANTS EQUIPMENT",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "BONALDI",
			"Project" : "sistema cambio matrici",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 47,
			"Name" : "fwefewfewf",
			"Description" : "",
			"Area" : "fewfew",
			"Pep" : "fewfew",
			"PR" : "432432432",
			"MaterialGroup" : "AUTOMOTORES",
			"Plant" : "fewfew",
			"Company" : "fewfew",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "F",
			"Project" : "fewfewfew",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 46,
			"Name" : "ewqe",
			"Description" : "",
			"Area" : "fdsfsd",
			"Pep" : "ewqe",
			"PR" : "332432",
			"MaterialGroup" : "AUTOMOTORES",
			"Plant" : "fdewf",
			"Company" : "AR05",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T30687",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 40,
			"Name" : "Flota camionetas laminador",
			"Description" : "",
			"Area" : "",
			"Pep" : "10000011",
			"PR" : "2221212212",
			"MaterialGroup" : "AUTOMOTORES",
			"Plant" : "TM01",
			"Company" : "Tamsa",
			"Discount" : 0,
			"Budget" : 240000,
			"Currency" : "USD",
			"Leader" : "",
			"Project" : "Flota camionetas para Laminador",
			"PepProject" : "",
			"Owner" : "SIDERCA\\13533",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 43,
			"Name" : "fewfewf",
			"Description" : "",
			"Area" : "FEWFEWF",
			"Pep" : "fewfew",
			"PR" : "FEW",
			"MaterialGroup" : "AUTOMOTORES",
			"Plant" : "FEWFEW",
			"Company" : "FEWFEW",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "fwefewfew",
			"PepProject" : "",
			"Owner" : "DIR\\PEDRO.ROBERTO.GADEA",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 34,
			"Name" : "Line stive bomboloni\t",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "ZOGGIA",
			"Project" : "stive bomboloni",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 33,
			"Name" : "Line  montaggi elettrici per impianto Wifi \t",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "21782445",
			"MaterialGroup" : "",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : " montaggi elettrici per impianto Wifi ",
			"PepProject" : "",
			"Owner" : "SIDERCA\\T32606",
			"Criticity" : "",
			"State" : "Sourcing"
		},
		{
			"Id" : 11,
			"Name" : "Linea Modifica handling per Tenari Denmark",
			"Description" : "",
			"Area" : "",
			"Pep" : "",
			"PR" : "",
			"MaterialGroup" : "",
			"Plant" : "",
			"Company" : "",
			"Discount" : 0,
			"Budget" : 0,
			"Currency" : "",
			"Leader" : "",
			"Project" : "Modifica handling per Tenari Denmark",
			"PepProject" : "",
			"Owner" : "DIR\\LUCAS.DEGANIS",
			"Criticity" : "",
			"State" : "Sourcing"
		}
	];

	$("#gridTracking").kendoGrid(
	{
		dataSource :
		{
			type : "json",
			data : dataInfo,
			schema :
			{
				model :
				{
					fields :
					{
						Id :
						{
							type : "number"
						}
					}
				}
			}
		},
		sortable :
		{
			mode : "multiple"
		},
		groupable :
		{
			messages :
			{
				empty : "Drag a column and group."
			}
		},
		height : 450,
		scrollable : true,
		selectable : true,
		resizable : true,
		reorderable : true,
		columns : [
			{
				field : "Name",
				title : "ID"
			},
			{
				field : "MaterialGroup",
				title : "Description"
			},			
			{
				field : "Area",
				title : "Project Name"
			},
			{
				field : "PR",
				title : "Project Description"
			},
			{
				field : "Name",
				title : "InternalReference"
			},
									{
				field : "Pep",
				title : "ReleaseIndicator"
			},
									{
				field : "Pep",
				title : "ExchangeRate"
			},
						{
				field : "Pep",
				title : "TotalAmount"
			},
						{
				field : "Pep",
				title : "TotalAmountUSD"
			},
						{
				field : "Pep",
				title : "TotalAmountWithTAXUSD"
			},
			{
				field : "Plant",
				title : "DocType"
			},
			{
				field : "Name",
				title : "Incoterm1"
			},
			{
				field : "Plant",
				title : "Incoterm2"
			},
			{
				field : "PepProject",
				title : "DocClass"
			},
			{
				field : "Pep",
				title : "PaymentTerms"
			},
/* 			{
				field : "Discount",
				title : "Discount"
			}, */
			{
				field : "Budget",
				title : "CompanyExiros.LongDescription"
			},
     		{
				field : "Currency",
				title : "Currency"
			}, 
			{
				field : "Criticity",
				title : "PlantExiros LongDescription"
			},
			{
				field : "Leader",
				title : "PurchaseGroup LongDescription"
			},
			{
				field : "Owner",
				title : "Purchase Organization ID"
			},
			{
				field : "Project",
				title : "Supplier ExirosID"
			}
		]

	}
	);

	$("#gridTracking").on("dblclick", "tr.k-state-selected", function ()
	{
		$("#detail-module").removeClass("full-size");
		$("#detail-module").addClass("mid-size");

		//Enviar parametro del projecto seleccionado al detalle aca
	}
	);
	
	//Maximizar y minimizar del panel inferior
	$("#btnNewProject").click(function ()
	{		
		$("#detail-module").removeClass("mid-size");
		$("#detail-module").addClass("full-size");
	}
	);
}
);
